#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n;
	cin >> n;
	int a[n + 10];
	for(int i = 1; i <= n; i ++ ) {
		cin >> a[i];
	}
	sort(a + 1, a + n + 1);
	bool flag = true;
	for(int i = 1; i <= n - 2; i ++ ) {
		if(a[i]  >= a[i + 2] ) {
			flag = false;
			break;
		} else {
			if(a[i + 1] == 0) {
				flag = false;
				break;
			}
		}
	}
	if(flag) {
		cout << "YES" << endl;
		for(int i = 1; i <= n; i ++ ) {
			cout << a[i] << " ";
		}
	} else {
		cout << "NO" << endl;
	}
	return 0;
}

